<?php


namespace App\Admin\Controllers;


use App\Models\Cities;
use Dcat\Admin\Http\Controllers\AdminController;
use Illuminate\Http\Request;

class CityController extends AdminController
{
      public function city(Request $request)
      {
          $provinceId = $request->get('q');
          return Cities::where('pid',$provinceId)->get(['id','name as text']);
      }

      public function region(Request $request)
      {
          $cityId = $request->get('q');
          return Cities::where('pid',$cityId)->get(['id','name as text']);
      }
}
